[MIRROR] Final optimizations for reagent holder #804
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mirrored on Skyrat: Skyrat-SS13/Skyrat-tg#25216
Original PR: tgstation/tgstation#79862
About The Pull Request
Yup this is the last time I'll lay hands on
holder.dm
after 2 rounds of code compression the file was still over 2000 lines long so now the next best thing to reduce it is organizing procs into logical files, that and even more proc removals. As you can see we are still able to reduce code size even further1. Removes & merges
expose_multiple()
proc intoexpose()
Th only difference between these 2 procs is that
expose()
uses all reagents inside the holder whereasexpose_multiple()
uses a select few reagents. We can just add a 4th parameter toexpose()
that will accept a list of reagents thus achieving the same results and that was done reducing overall code2. Removes
conditonal_update()
proc &on_update()
procThe proc
on_update()
definition is empty and no reagent was overriding it and as a resultconditonal_update()
that calls this proc is also functionally useless therefore both of these procs were removed reducing overall code3. Finally splits
holder.dm
into logical files under the foldercode/modules/reagents/holder
holder.dm
: this is the still the file for core functionality it's just now moved into this new folder. Added comments to group procs under separate categories for easy readability.mob_life.dm
: contains reagent code for metabolizing reagents and for handling stasisreactions.dm
: all code for reagents reacting inside the holderproperties.dm
: procs for editing/reading the volume, temperature, ph, purity properties of reagents inside the holder, also for reading its taste descriptionui_data.dm
: all code for displaying & interacting with reagent data via UIChangelog
🆑 SyncIt21
code: removes & merges
expose_multiple()
proc intoexpose()
proc inside reagent holdercode: removes
conditonal_update()
proc &on_update()
proc inside reagent holder and reagentrefactor: Reagent code has been trimmed and split into multiple files. report bugs on github
/:cl: